package com.usian.mapper;

import com.usian.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

@Component
public interface UserMapper {

    @Select("select count(*) from user where userName=#{userName} and passWord=#{passWord}")
    Integer toLogin(User user);

    @Select("select count(*) from user where userName=#{userName}")
    Integer toCompare(User user);

    @Insert("insert into user value(null,#{userName},#{passWord},#{createTime},#{roleId})")
    void insertUser(User user);

    @Select("select * from user where userName=#{userName}")
    User findByUserName(String userName);
}
